/**
 * 判断文件存不存在/目录
 */
const fs = require("fs");
console.log(fs.constants);
fs.access("a", fs.constants.F_OK, (err) => {
  if (err) {
    console.log("File does not exist");
  } else {
    console.log("File exists");
  }
});
try {
  fs.accessSync("a", fs.constants.F_OK);
  console.log("File exists");
} catch (error) {
  console.log("File does not exist");
}
